/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: Coordination.proto

package org.apache.drill.exec.proto;

public final class CoordinationProtos {
  private CoordinationProtos() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public interface DrillbitEndpointOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional string address = 1;
    /**
     * <code>optional string address = 1;</code>
     */
    boolean hasAddress();
    /**
     * <code>optional string address = 1;</code>
     */
    java.lang.String getAddress();
    /**
     * <code>optional string address = 1;</code>
     */
    com.google.protobuf.ByteString
        getAddressBytes();

    // optional int32 user_port = 2;
    /**
     * <code>optional int32 user_port = 2;</code>
     */
    boolean hasUserPort();
    /**
     * <code>optional int32 user_port = 2;</code>
     */
    int getUserPort();

    // optional int32 control_port = 3;
    /**
     * <code>optional int32 control_port = 3;</code>
     */
    boolean hasControlPort();
    /**
     * <code>optional int32 control_port = 3;</code>
     */
    int getControlPort();

    // optional int32 data_port = 4;
    /**
     * <code>optional int32 data_port = 4;</code>
     */
    boolean hasDataPort();
    /**
     * <code>optional int32 data_port = 4;</code>
     */
    int getDataPort();

    // optional .exec.Roles roles = 5;
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    boolean hasRoles();
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    org.apache.drill.exec.proto.CoordinationProtos.Roles getRoles();
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder getRolesOrBuilder();

    // optional string version = 6;
    /**
     * <code>optional string version = 6;</code>
     */
    boolean hasVersion();
    /**
     * <code>optional string version = 6;</code>
     */
    java.lang.String getVersion();
    /**
     * <code>optional string version = 6;</code>
     */
    com.google.protobuf.ByteString
        getVersionBytes();

    // optional .exec.DrillbitEndpoint.State state = 7;
    /**
     * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
     */
    boolean hasState();
    /**
     * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
     */
    org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State getState();
  }
  /**
   * Protobuf type {@code exec.DrillbitEndpoint}
   */
  public static final class DrillbitEndpoint extends
      com.google.protobuf.GeneratedMessage
      implements DrillbitEndpointOrBuilder {
    // Use DrillbitEndpoint.newBuilder() to construct.
    private DrillbitEndpoint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private DrillbitEndpoint(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final DrillbitEndpoint defaultInstance;
    public static DrillbitEndpoint getDefaultInstance() {
      return defaultInstance;
    }

    public DrillbitEndpoint getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private DrillbitEndpoint(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              address_ = input.readBytes();
              break;
            }
            case 16: {
              bitField0_ |= 0x00000002;
              userPort_ = input.readInt32();
              break;
            }
            case 24: {
              bitField0_ |= 0x00000004;
              controlPort_ = input.readInt32();
              break;
            }
            case 32: {
              bitField0_ |= 0x00000008;
              dataPort_ = input.readInt32();
              break;
            }
            case 42: {
              org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder subBuilder = null;
              if (((bitField0_ & 0x00000010) == 0x00000010)) {
                subBuilder = roles_.toBuilder();
              }
              roles_ = input.readMessage(org.apache.drill.exec.proto.CoordinationProtos.Roles.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(roles_);
                roles_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000010;
              break;
            }
            case 50: {
              bitField0_ |= 0x00000020;
              version_ = input.readBytes();
              break;
            }
            case 56: {
              int rawValue = input.readEnum();
              org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State value = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(7, rawValue);
              } else {
                bitField0_ |= 0x00000040;
                state_ = value;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillbitEndpoint_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillbitEndpoint_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder.class);
    }

    public static com.google.protobuf.Parser<DrillbitEndpoint> PARSER =
        new com.google.protobuf.AbstractParser<DrillbitEndpoint>() {
      public DrillbitEndpoint parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new DrillbitEndpoint(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<DrillbitEndpoint> getParserForType() {
      return PARSER;
    }

    /**
     * Protobuf enum {@code exec.DrillbitEndpoint.State}
     */
    public enum State
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * <code>STARTUP = 0;</code>
       */
      STARTUP(0, 0),
      /**
       * <code>ONLINE = 1;</code>
       */
      ONLINE(1, 1),
      /**
       * <code>QUIESCENT = 2;</code>
       */
      QUIESCENT(2, 2),
      /**
       * <code>OFFLINE = 3;</code>
       */
      OFFLINE(3, 3),
      ;

      /**
       * <code>STARTUP = 0;</code>
       */
      public static final int STARTUP_VALUE = 0;
      /**
       * <code>ONLINE = 1;</code>
       */
      public static final int ONLINE_VALUE = 1;
      /**
       * <code>QUIESCENT = 2;</code>
       */
      public static final int QUIESCENT_VALUE = 2;
      /**
       * <code>OFFLINE = 3;</code>
       */
      public static final int OFFLINE_VALUE = 3;


      public final int getNumber() { return value; }

      public static State valueOf(int value) {
        switch (value) {
          case 0: return STARTUP;
          case 1: return ONLINE;
          case 2: return QUIESCENT;
          case 3: return OFFLINE;
          default: return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<State>
          internalGetValueMap() {
        return internalValueMap;
      }
      private static com.google.protobuf.Internal.EnumLiteMap<State>
          internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<State>() {
              public State findValueByNumber(int number) {
                return State.valueOf(number);
              }
            };

      public final com.google.protobuf.Descriptors.EnumValueDescriptor
          getValueDescriptor() {
        return getDescriptor().getValues().get(index);
      }
      public final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptorForType() {
        return getDescriptor();
      }
      public static final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDescriptor().getEnumTypes().get(0);
      }

      private static final State[] VALUES = values();

      public static State valueOf(
          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
          throw new java.lang.IllegalArgumentException(
            "EnumValueDescriptor is not for this type.");
        }
        return VALUES[desc.getIndex()];
      }

      private final int index;
      private final int value;

      private State(int index, int value) {
        this.index = index;
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:exec.DrillbitEndpoint.State)
    }

    private int bitField0_;
    // optional string address = 1;
    public static final int ADDRESS_FIELD_NUMBER = 1;
    private java.lang.Object address_;
    /**
     * <code>optional string address = 1;</code>
     */
    public boolean hasAddress() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional string address = 1;</code>
     */
    public java.lang.String getAddress() {
      java.lang.Object ref = address_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          address_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string address = 1;</code>
     */
    public com.google.protobuf.ByteString
        getAddressBytes() {
      java.lang.Object ref = address_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        address_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional int32 user_port = 2;
    public static final int USER_PORT_FIELD_NUMBER = 2;
    private int userPort_;
    /**
     * <code>optional int32 user_port = 2;</code>
     */
    public boolean hasUserPort() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional int32 user_port = 2;</code>
     */
    public int getUserPort() {
      return userPort_;
    }

    // optional int32 control_port = 3;
    public static final int CONTROL_PORT_FIELD_NUMBER = 3;
    private int controlPort_;
    /**
     * <code>optional int32 control_port = 3;</code>
     */
    public boolean hasControlPort() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional int32 control_port = 3;</code>
     */
    public int getControlPort() {
      return controlPort_;
    }

    // optional int32 data_port = 4;
    public static final int DATA_PORT_FIELD_NUMBER = 4;
    private int dataPort_;
    /**
     * <code>optional int32 data_port = 4;</code>
     */
    public boolean hasDataPort() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional int32 data_port = 4;</code>
     */
    public int getDataPort() {
      return dataPort_;
    }

    // optional .exec.Roles roles = 5;
    public static final int ROLES_FIELD_NUMBER = 5;
    private org.apache.drill.exec.proto.CoordinationProtos.Roles roles_;
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    public boolean hasRoles() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    public org.apache.drill.exec.proto.CoordinationProtos.Roles getRoles() {
      return roles_;
    }
    /**
     * <code>optional .exec.Roles roles = 5;</code>
     */
    public org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder getRolesOrBuilder() {
      return roles_;
    }

    // optional string version = 6;
    public static final int VERSION_FIELD_NUMBER = 6;
    private java.lang.Object version_;
    /**
     * <code>optional string version = 6;</code>
     */
    public boolean hasVersion() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional string version = 6;</code>
     */
    public java.lang.String getVersion() {
      java.lang.Object ref = version_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          version_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string version = 6;</code>
     */
    public com.google.protobuf.ByteString
        getVersionBytes() {
      java.lang.Object ref = version_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        version_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .exec.DrillbitEndpoint.State state = 7;
    public static final int STATE_FIELD_NUMBER = 7;
    private org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State state_;
    /**
     * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
     */
    public boolean hasState() {
      return ((bitField0_ & 0x00000040) == 0x00000040);
    }
    /**
     * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
     */
    public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State getState() {
      return state_;
    }

    private void initFields() {
      address_ = "";
      userPort_ = 0;
      controlPort_ = 0;
      dataPort_ = 0;
      roles_ = org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance();
      version_ = "";
      state_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.STARTUP;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getAddressBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeInt32(2, userPort_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeInt32(3, controlPort_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeInt32(4, dataPort_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeMessage(5, roles_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBytes(6, getVersionBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeEnum(7, state_.getNumber());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getAddressBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, userPort_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(3, controlPort_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(4, dataPort_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, roles_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(6, getVersionBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(7, state_.getNumber());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.DrillbitEndpoint}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillbitEndpoint_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillbitEndpoint_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getRolesFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        address_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        userPort_ = 0;
        bitField0_ = (bitField0_ & ~0x00000002);
        controlPort_ = 0;
        bitField0_ = (bitField0_ & ~0x00000004);
        dataPort_ = 0;
        bitField0_ = (bitField0_ & ~0x00000008);
        if (rolesBuilder_ == null) {
          roles_ = org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance();
        } else {
          rolesBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        version_ = "";
        bitField0_ = (bitField0_ & ~0x00000020);
        state_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.STARTUP;
        bitField0_ = (bitField0_ & ~0x00000040);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillbitEndpoint_descriptor;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint build() {
        org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint buildPartial() {
        org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint result = new org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.address_ = address_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.userPort_ = userPort_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.controlPort_ = controlPort_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.dataPort_ = dataPort_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        if (rolesBuilder_ == null) {
          result.roles_ = roles_;
        } else {
          result.roles_ = rolesBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000020;
        }
        result.version_ = version_;
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000040;
        }
        result.state_ = state_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint) {
          return mergeFrom((org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint other) {
        if (other == org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance()) return this;
        if (other.hasAddress()) {
          bitField0_ |= 0x00000001;
          address_ = other.address_;
          onChanged();
        }
        if (other.hasUserPort()) {
          setUserPort(other.getUserPort());
        }
        if (other.hasControlPort()) {
          setControlPort(other.getControlPort());
        }
        if (other.hasDataPort()) {
          setDataPort(other.getDataPort());
        }
        if (other.hasRoles()) {
          mergeRoles(other.getRoles());
        }
        if (other.hasVersion()) {
          bitField0_ |= 0x00000020;
          version_ = other.version_;
          onChanged();
        }
        if (other.hasState()) {
          setState(other.getState());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional string address = 1;
      private java.lang.Object address_ = "";
      /**
       * <code>optional string address = 1;</code>
       */
      public boolean hasAddress() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional string address = 1;</code>
       */
      public java.lang.String getAddress() {
        java.lang.Object ref = address_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          address_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string address = 1;</code>
       */
      public com.google.protobuf.ByteString
          getAddressBytes() {
        java.lang.Object ref = address_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          address_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string address = 1;</code>
       */
      public Builder setAddress(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        address_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string address = 1;</code>
       */
      public Builder clearAddress() {
        bitField0_ = (bitField0_ & ~0x00000001);
        address_ = getDefaultInstance().getAddress();
        onChanged();
        return this;
      }
      /**
       * <code>optional string address = 1;</code>
       */
      public Builder setAddressBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        address_ = value;
        onChanged();
        return this;
      }

      // optional int32 user_port = 2;
      private int userPort_ ;
      /**
       * <code>optional int32 user_port = 2;</code>
       */
      public boolean hasUserPort() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional int32 user_port = 2;</code>
       */
      public int getUserPort() {
        return userPort_;
      }
      /**
       * <code>optional int32 user_port = 2;</code>
       */
      public Builder setUserPort(int value) {
        bitField0_ |= 0x00000002;
        userPort_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 user_port = 2;</code>
       */
      public Builder clearUserPort() {
        bitField0_ = (bitField0_ & ~0x00000002);
        userPort_ = 0;
        onChanged();
        return this;
      }

      // optional int32 control_port = 3;
      private int controlPort_ ;
      /**
       * <code>optional int32 control_port = 3;</code>
       */
      public boolean hasControlPort() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional int32 control_port = 3;</code>
       */
      public int getControlPort() {
        return controlPort_;
      }
      /**
       * <code>optional int32 control_port = 3;</code>
       */
      public Builder setControlPort(int value) {
        bitField0_ |= 0x00000004;
        controlPort_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 control_port = 3;</code>
       */
      public Builder clearControlPort() {
        bitField0_ = (bitField0_ & ~0x00000004);
        controlPort_ = 0;
        onChanged();
        return this;
      }

      // optional int32 data_port = 4;
      private int dataPort_ ;
      /**
       * <code>optional int32 data_port = 4;</code>
       */
      public boolean hasDataPort() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional int32 data_port = 4;</code>
       */
      public int getDataPort() {
        return dataPort_;
      }
      /**
       * <code>optional int32 data_port = 4;</code>
       */
      public Builder setDataPort(int value) {
        bitField0_ |= 0x00000008;
        dataPort_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 data_port = 4;</code>
       */
      public Builder clearDataPort() {
        bitField0_ = (bitField0_ & ~0x00000008);
        dataPort_ = 0;
        onChanged();
        return this;
      }

      // optional .exec.Roles roles = 5;
      private org.apache.drill.exec.proto.CoordinationProtos.Roles roles_ = org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.CoordinationProtos.Roles, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder, org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder> rolesBuilder_;
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public boolean hasRoles() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.Roles getRoles() {
        if (rolesBuilder_ == null) {
          return roles_;
        } else {
          return rolesBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public Builder setRoles(org.apache.drill.exec.proto.CoordinationProtos.Roles value) {
        if (rolesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          roles_ = value;
          onChanged();
        } else {
          rolesBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public Builder setRoles(
          org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder builderForValue) {
        if (rolesBuilder_ == null) {
          roles_ = builderForValue.build();
          onChanged();
        } else {
          rolesBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public Builder mergeRoles(org.apache.drill.exec.proto.CoordinationProtos.Roles value) {
        if (rolesBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010) &&
              roles_ != org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance()) {
            roles_ =
              org.apache.drill.exec.proto.CoordinationProtos.Roles.newBuilder(roles_).mergeFrom(value).buildPartial();
          } else {
            roles_ = value;
          }
          onChanged();
        } else {
          rolesBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public Builder clearRoles() {
        if (rolesBuilder_ == null) {
          roles_ = org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance();
          onChanged();
        } else {
          rolesBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder getRolesBuilder() {
        bitField0_ |= 0x00000010;
        onChanged();
        return getRolesFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder getRolesOrBuilder() {
        if (rolesBuilder_ != null) {
          return rolesBuilder_.getMessageOrBuilder();
        } else {
          return roles_;
        }
      }
      /**
       * <code>optional .exec.Roles roles = 5;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.CoordinationProtos.Roles, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder, org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder> 
          getRolesFieldBuilder() {
        if (rolesBuilder_ == null) {
          rolesBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.apache.drill.exec.proto.CoordinationProtos.Roles, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder, org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder>(
                  roles_,
                  getParentForChildren(),
                  isClean());
          roles_ = null;
        }
        return rolesBuilder_;
      }

      // optional string version = 6;
      private java.lang.Object version_ = "";
      /**
       * <code>optional string version = 6;</code>
       */
      public boolean hasVersion() {
        return ((bitField0_ & 0x00000020) == 0x00000020);
      }
      /**
       * <code>optional string version = 6;</code>
       */
      public java.lang.String getVersion() {
        java.lang.Object ref = version_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          version_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string version = 6;</code>
       */
      public com.google.protobuf.ByteString
          getVersionBytes() {
        java.lang.Object ref = version_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          version_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string version = 6;</code>
       */
      public Builder setVersion(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000020;
        version_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string version = 6;</code>
       */
      public Builder clearVersion() {
        bitField0_ = (bitField0_ & ~0x00000020);
        version_ = getDefaultInstance().getVersion();
        onChanged();
        return this;
      }
      /**
       * <code>optional string version = 6;</code>
       */
      public Builder setVersionBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000020;
        version_ = value;
        onChanged();
        return this;
      }

      // optional .exec.DrillbitEndpoint.State state = 7;
      private org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State state_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.STARTUP;
      /**
       * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
       */
      public boolean hasState() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State getState() {
        return state_;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
       */
      public Builder setState(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000040;
        state_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint.State state = 7;</code>
       */
      public Builder clearState() {
        bitField0_ = (bitField0_ & ~0x00000040);
        state_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.STARTUP;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:exec.DrillbitEndpoint)
    }

    static {
      defaultInstance = new DrillbitEndpoint(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.DrillbitEndpoint)
  }

  public interface DrillServiceInstanceOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional string id = 1;
    /**
     * <code>optional string id = 1;</code>
     */
    boolean hasId();
    /**
     * <code>optional string id = 1;</code>
     */
    java.lang.String getId();
    /**
     * <code>optional string id = 1;</code>
     */
    com.google.protobuf.ByteString
        getIdBytes();

    // optional int64 registrationTimeUTC = 2;
    /**
     * <code>optional int64 registrationTimeUTC = 2;</code>
     */
    boolean hasRegistrationTimeUTC();
    /**
     * <code>optional int64 registrationTimeUTC = 2;</code>
     */
    long getRegistrationTimeUTC();

    // optional .exec.DrillbitEndpoint endpoint = 3;
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    boolean hasEndpoint();
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint getEndpoint();
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder getEndpointOrBuilder();
  }
  /**
   * Protobuf type {@code exec.DrillServiceInstance}
   */
  public static final class DrillServiceInstance extends
      com.google.protobuf.GeneratedMessage
      implements DrillServiceInstanceOrBuilder {
    // Use DrillServiceInstance.newBuilder() to construct.
    private DrillServiceInstance(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private DrillServiceInstance(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final DrillServiceInstance defaultInstance;
    public static DrillServiceInstance getDefaultInstance() {
      return defaultInstance;
    }

    public DrillServiceInstance getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private DrillServiceInstance(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              id_ = input.readBytes();
              break;
            }
            case 16: {
              bitField0_ |= 0x00000002;
              registrationTimeUTC_ = input.readInt64();
              break;
            }
            case 26: {
              org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder subBuilder = null;
              if (((bitField0_ & 0x00000004) == 0x00000004)) {
                subBuilder = endpoint_.toBuilder();
              }
              endpoint_ = input.readMessage(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(endpoint_);
                endpoint_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000004;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillServiceInstance_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillServiceInstance_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder.class);
    }

    public static com.google.protobuf.Parser<DrillServiceInstance> PARSER =
        new com.google.protobuf.AbstractParser<DrillServiceInstance>() {
      public DrillServiceInstance parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new DrillServiceInstance(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<DrillServiceInstance> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // optional string id = 1;
    public static final int ID_FIELD_NUMBER = 1;
    private java.lang.Object id_;
    /**
     * <code>optional string id = 1;</code>
     */
    public boolean hasId() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional string id = 1;</code>
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          id_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string id = 1;</code>
     */
    public com.google.protobuf.ByteString
        getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional int64 registrationTimeUTC = 2;
    public static final int REGISTRATIONTIMEUTC_FIELD_NUMBER = 2;
    private long registrationTimeUTC_;
    /**
     * <code>optional int64 registrationTimeUTC = 2;</code>
     */
    public boolean hasRegistrationTimeUTC() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional int64 registrationTimeUTC = 2;</code>
     */
    public long getRegistrationTimeUTC() {
      return registrationTimeUTC_;
    }

    // optional .exec.DrillbitEndpoint endpoint = 3;
    public static final int ENDPOINT_FIELD_NUMBER = 3;
    private org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint endpoint_;
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    public boolean hasEndpoint() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint getEndpoint() {
      return endpoint_;
    }
    /**
     * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
     */
    public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder getEndpointOrBuilder() {
      return endpoint_;
    }

    private void initFields() {
      id_ = "";
      registrationTimeUTC_ = 0L;
      endpoint_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getIdBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeInt64(2, registrationTimeUTC_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeMessage(3, endpoint_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getIdBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(2, registrationTimeUTC_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, endpoint_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.DrillServiceInstance}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstanceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillServiceInstance_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillServiceInstance_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getEndpointFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        id_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        registrationTimeUTC_ = 0L;
        bitField0_ = (bitField0_ & ~0x00000002);
        if (endpointBuilder_ == null) {
          endpoint_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
        } else {
          endpointBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_DrillServiceInstance_descriptor;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance build() {
        org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance buildPartial() {
        org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance result = new org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.id_ = id_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.registrationTimeUTC_ = registrationTimeUTC_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        if (endpointBuilder_ == null) {
          result.endpoint_ = endpoint_;
        } else {
          result.endpoint_ = endpointBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance) {
          return mergeFrom((org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance other) {
        if (other == org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.getDefaultInstance()) return this;
        if (other.hasId()) {
          bitField0_ |= 0x00000001;
          id_ = other.id_;
          onChanged();
        }
        if (other.hasRegistrationTimeUTC()) {
          setRegistrationTimeUTC(other.getRegistrationTimeUTC());
        }
        if (other.hasEndpoint()) {
          mergeEndpoint(other.getEndpoint());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional string id = 1;
      private java.lang.Object id_ = "";
      /**
       * <code>optional string id = 1;</code>
       */
      public boolean hasId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional string id = 1;</code>
       */
      public java.lang.String getId() {
        java.lang.Object ref = id_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          id_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string id = 1;</code>
       */
      public com.google.protobuf.ByteString
          getIdBytes() {
        java.lang.Object ref = id_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          id_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string id = 1;</code>
       */
      public Builder setId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        id_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string id = 1;</code>
       */
      public Builder clearId() {
        bitField0_ = (bitField0_ & ~0x00000001);
        id_ = getDefaultInstance().getId();
        onChanged();
        return this;
      }
      /**
       * <code>optional string id = 1;</code>
       */
      public Builder setIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        id_ = value;
        onChanged();
        return this;
      }

      // optional int64 registrationTimeUTC = 2;
      private long registrationTimeUTC_ ;
      /**
       * <code>optional int64 registrationTimeUTC = 2;</code>
       */
      public boolean hasRegistrationTimeUTC() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional int64 registrationTimeUTC = 2;</code>
       */
      public long getRegistrationTimeUTC() {
        return registrationTimeUTC_;
      }
      /**
       * <code>optional int64 registrationTimeUTC = 2;</code>
       */
      public Builder setRegistrationTimeUTC(long value) {
        bitField0_ |= 0x00000002;
        registrationTimeUTC_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int64 registrationTimeUTC = 2;</code>
       */
      public Builder clearRegistrationTimeUTC() {
        bitField0_ = (bitField0_ & ~0x00000002);
        registrationTimeUTC_ = 0L;
        onChanged();
        return this;
      }

      // optional .exec.DrillbitEndpoint endpoint = 3;
      private org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint endpoint_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder> endpointBuilder_;
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public boolean hasEndpoint() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint getEndpoint() {
        if (endpointBuilder_ == null) {
          return endpoint_;
        } else {
          return endpointBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public Builder setEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint value) {
        if (endpointBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          endpoint_ = value;
          onChanged();
        } else {
          endpointBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public Builder setEndpoint(
          org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder builderForValue) {
        if (endpointBuilder_ == null) {
          endpoint_ = builderForValue.build();
          onChanged();
        } else {
          endpointBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public Builder mergeEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint value) {
        if (endpointBuilder_ == null) {
          if (((bitField0_ & 0x00000004) == 0x00000004) &&
              endpoint_ != org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance()) {
            endpoint_ =
              org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.newBuilder(endpoint_).mergeFrom(value).buildPartial();
          } else {
            endpoint_ = value;
          }
          onChanged();
        } else {
          endpointBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public Builder clearEndpoint() {
        if (endpointBuilder_ == null) {
          endpoint_ = org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
          onChanged();
        } else {
          endpointBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder getEndpointBuilder() {
        bitField0_ |= 0x00000004;
        onChanged();
        return getEndpointFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder getEndpointOrBuilder() {
        if (endpointBuilder_ != null) {
          return endpointBuilder_.getMessageOrBuilder();
        } else {
          return endpoint_;
        }
      }
      /**
       * <code>optional .exec.DrillbitEndpoint endpoint = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder> 
          getEndpointFieldBuilder() {
        if (endpointBuilder_ == null) {
          endpointBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpointOrBuilder>(
                  endpoint_,
                  getParentForChildren(),
                  isClean());
          endpoint_ = null;
        }
        return endpointBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:exec.DrillServiceInstance)
    }

    static {
      defaultInstance = new DrillServiceInstance(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.DrillServiceInstance)
  }

  public interface RolesOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional bool sql_query = 1 [default = true];
    /**
     * <code>optional bool sql_query = 1 [default = true];</code>
     */
    boolean hasSqlQuery();
    /**
     * <code>optional bool sql_query = 1 [default = true];</code>
     */
    boolean getSqlQuery();

    // optional bool logical_plan = 2 [default = true];
    /**
     * <code>optional bool logical_plan = 2 [default = true];</code>
     */
    boolean hasLogicalPlan();
    /**
     * <code>optional bool logical_plan = 2 [default = true];</code>
     */
    boolean getLogicalPlan();

    // optional bool physical_plan = 3 [default = true];
    /**
     * <code>optional bool physical_plan = 3 [default = true];</code>
     */
    boolean hasPhysicalPlan();
    /**
     * <code>optional bool physical_plan = 3 [default = true];</code>
     */
    boolean getPhysicalPlan();

    // optional bool java_executor = 4 [default = true];
    /**
     * <code>optional bool java_executor = 4 [default = true];</code>
     */
    boolean hasJavaExecutor();
    /**
     * <code>optional bool java_executor = 4 [default = true];</code>
     */
    boolean getJavaExecutor();

    // optional bool distributed_cache = 5 [default = true];
    /**
     * <code>optional bool distributed_cache = 5 [default = true];</code>
     */
    boolean hasDistributedCache();
    /**
     * <code>optional bool distributed_cache = 5 [default = true];</code>
     */
    boolean getDistributedCache();
  }
  /**
   * Protobuf type {@code exec.Roles}
   */
  public static final class Roles extends
      com.google.protobuf.GeneratedMessage
      implements RolesOrBuilder {
    // Use Roles.newBuilder() to construct.
    private Roles(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Roles(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Roles defaultInstance;
    public static Roles getDefaultInstance() {
      return defaultInstance;
    }

    public Roles getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Roles(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000001;
              sqlQuery_ = input.readBool();
              break;
            }
            case 16: {
              bitField0_ |= 0x00000002;
              logicalPlan_ = input.readBool();
              break;
            }
            case 24: {
              bitField0_ |= 0x00000004;
              physicalPlan_ = input.readBool();
              break;
            }
            case 32: {
              bitField0_ |= 0x00000008;
              javaExecutor_ = input.readBool();
              break;
            }
            case 40: {
              bitField0_ |= 0x00000010;
              distributedCache_ = input.readBool();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_Roles_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_Roles_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.CoordinationProtos.Roles.class, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder.class);
    }

    public static com.google.protobuf.Parser<Roles> PARSER =
        new com.google.protobuf.AbstractParser<Roles>() {
      public Roles parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Roles(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Roles> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // optional bool sql_query = 1 [default = true];
    public static final int SQL_QUERY_FIELD_NUMBER = 1;
    private boolean sqlQuery_;
    /**
     * <code>optional bool sql_query = 1 [default = true];</code>
     */
    public boolean hasSqlQuery() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional bool sql_query = 1 [default = true];</code>
     */
    public boolean getSqlQuery() {
      return sqlQuery_;
    }

    // optional bool logical_plan = 2 [default = true];
    public static final int LOGICAL_PLAN_FIELD_NUMBER = 2;
    private boolean logicalPlan_;
    /**
     * <code>optional bool logical_plan = 2 [default = true];</code>
     */
    public boolean hasLogicalPlan() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional bool logical_plan = 2 [default = true];</code>
     */
    public boolean getLogicalPlan() {
      return logicalPlan_;
    }

    // optional bool physical_plan = 3 [default = true];
    public static final int PHYSICAL_PLAN_FIELD_NUMBER = 3;
    private boolean physicalPlan_;
    /**
     * <code>optional bool physical_plan = 3 [default = true];</code>
     */
    public boolean hasPhysicalPlan() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional bool physical_plan = 3 [default = true];</code>
     */
    public boolean getPhysicalPlan() {
      return physicalPlan_;
    }

    // optional bool java_executor = 4 [default = true];
    public static final int JAVA_EXECUTOR_FIELD_NUMBER = 4;
    private boolean javaExecutor_;
    /**
     * <code>optional bool java_executor = 4 [default = true];</code>
     */
    public boolean hasJavaExecutor() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional bool java_executor = 4 [default = true];</code>
     */
    public boolean getJavaExecutor() {
      return javaExecutor_;
    }

    // optional bool distributed_cache = 5 [default = true];
    public static final int DISTRIBUTED_CACHE_FIELD_NUMBER = 5;
    private boolean distributedCache_;
    /**
     * <code>optional bool distributed_cache = 5 [default = true];</code>
     */
    public boolean hasDistributedCache() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional bool distributed_cache = 5 [default = true];</code>
     */
    public boolean getDistributedCache() {
      return distributedCache_;
    }

    private void initFields() {
      sqlQuery_ = true;
      logicalPlan_ = true;
      physicalPlan_ = true;
      javaExecutor_ = true;
      distributedCache_ = true;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBool(1, sqlQuery_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBool(2, logicalPlan_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBool(3, physicalPlan_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBool(4, javaExecutor_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeBool(5, distributedCache_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(1, sqlQuery_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(2, logicalPlan_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(3, physicalPlan_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(4, javaExecutor_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(5, distributedCache_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.CoordinationProtos.Roles parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.CoordinationProtos.Roles prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.Roles}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.CoordinationProtos.RolesOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_Roles_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_Roles_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.CoordinationProtos.Roles.class, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.CoordinationProtos.Roles.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        sqlQuery_ = true;
        bitField0_ = (bitField0_ & ~0x00000001);
        logicalPlan_ = true;
        bitField0_ = (bitField0_ & ~0x00000002);
        physicalPlan_ = true;
        bitField0_ = (bitField0_ & ~0x00000004);
        javaExecutor_ = true;
        bitField0_ = (bitField0_ & ~0x00000008);
        distributedCache_ = true;
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.internal_static_exec_Roles_descriptor;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.Roles getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.CoordinationProtos.Roles build() {
        org.apache.drill.exec.proto.CoordinationProtos.Roles result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.CoordinationProtos.Roles buildPartial() {
        org.apache.drill.exec.proto.CoordinationProtos.Roles result = new org.apache.drill.exec.proto.CoordinationProtos.Roles(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.sqlQuery_ = sqlQuery_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.logicalPlan_ = logicalPlan_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.physicalPlan_ = physicalPlan_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.javaExecutor_ = javaExecutor_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.distributedCache_ = distributedCache_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.CoordinationProtos.Roles) {
          return mergeFrom((org.apache.drill.exec.proto.CoordinationProtos.Roles)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.CoordinationProtos.Roles other) {
        if (other == org.apache.drill.exec.proto.CoordinationProtos.Roles.getDefaultInstance()) return this;
        if (other.hasSqlQuery()) {
          setSqlQuery(other.getSqlQuery());
        }
        if (other.hasLogicalPlan()) {
          setLogicalPlan(other.getLogicalPlan());
        }
        if (other.hasPhysicalPlan()) {
          setPhysicalPlan(other.getPhysicalPlan());
        }
        if (other.hasJavaExecutor()) {
          setJavaExecutor(other.getJavaExecutor());
        }
        if (other.hasDistributedCache()) {
          setDistributedCache(other.getDistributedCache());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.CoordinationProtos.Roles parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.CoordinationProtos.Roles) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional bool sql_query = 1 [default = true];
      private boolean sqlQuery_ = true;
      /**
       * <code>optional bool sql_query = 1 [default = true];</code>
       */
      public boolean hasSqlQuery() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional bool sql_query = 1 [default = true];</code>
       */
      public boolean getSqlQuery() {
        return sqlQuery_;
      }
      /**
       * <code>optional bool sql_query = 1 [default = true];</code>
       */
      public Builder setSqlQuery(boolean value) {
        bitField0_ |= 0x00000001;
        sqlQuery_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool sql_query = 1 [default = true];</code>
       */
      public Builder clearSqlQuery() {
        bitField0_ = (bitField0_ & ~0x00000001);
        sqlQuery_ = true;
        onChanged();
        return this;
      }

      // optional bool logical_plan = 2 [default = true];
      private boolean logicalPlan_ = true;
      /**
       * <code>optional bool logical_plan = 2 [default = true];</code>
       */
      public boolean hasLogicalPlan() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional bool logical_plan = 2 [default = true];</code>
       */
      public boolean getLogicalPlan() {
        return logicalPlan_;
      }
      /**
       * <code>optional bool logical_plan = 2 [default = true];</code>
       */
      public Builder setLogicalPlan(boolean value) {
        bitField0_ |= 0x00000002;
        logicalPlan_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool logical_plan = 2 [default = true];</code>
       */
      public Builder clearLogicalPlan() {
        bitField0_ = (bitField0_ & ~0x00000002);
        logicalPlan_ = true;
        onChanged();
        return this;
      }

      // optional bool physical_plan = 3 [default = true];
      private boolean physicalPlan_ = true;
      /**
       * <code>optional bool physical_plan = 3 [default = true];</code>
       */
      public boolean hasPhysicalPlan() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional bool physical_plan = 3 [default = true];</code>
       */
      public boolean getPhysicalPlan() {
        return physicalPlan_;
      }
      /**
       * <code>optional bool physical_plan = 3 [default = true];</code>
       */
      public Builder setPhysicalPlan(boolean value) {
        bitField0_ |= 0x00000004;
        physicalPlan_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool physical_plan = 3 [default = true];</code>
       */
      public Builder clearPhysicalPlan() {
        bitField0_ = (bitField0_ & ~0x00000004);
        physicalPlan_ = true;
        onChanged();
        return this;
      }

      // optional bool java_executor = 4 [default = true];
      private boolean javaExecutor_ = true;
      /**
       * <code>optional bool java_executor = 4 [default = true];</code>
       */
      public boolean hasJavaExecutor() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional bool java_executor = 4 [default = true];</code>
       */
      public boolean getJavaExecutor() {
        return javaExecutor_;
      }
      /**
       * <code>optional bool java_executor = 4 [default = true];</code>
       */
      public Builder setJavaExecutor(boolean value) {
        bitField0_ |= 0x00000008;
        javaExecutor_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool java_executor = 4 [default = true];</code>
       */
      public Builder clearJavaExecutor() {
        bitField0_ = (bitField0_ & ~0x00000008);
        javaExecutor_ = true;
        onChanged();
        return this;
      }

      // optional bool distributed_cache = 5 [default = true];
      private boolean distributedCache_ = true;
      /**
       * <code>optional bool distributed_cache = 5 [default = true];</code>
       */
      public boolean hasDistributedCache() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional bool distributed_cache = 5 [default = true];</code>
       */
      public boolean getDistributedCache() {
        return distributedCache_;
      }
      /**
       * <code>optional bool distributed_cache = 5 [default = true];</code>
       */
      public Builder setDistributedCache(boolean value) {
        bitField0_ |= 0x00000010;
        distributedCache_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool distributed_cache = 5 [default = true];</code>
       */
      public Builder clearDistributedCache() {
        bitField0_ = (bitField0_ & ~0x00000010);
        distributedCache_ = true;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:exec.Roles)
    }

    static {
      defaultInstance = new Roles(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.Roles)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_DrillbitEndpoint_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_DrillbitEndpoint_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_DrillServiceInstance_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_DrillServiceInstance_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_Roles_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_Roles_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\022Coordination.proto\022\004exec\"\367\001\n\020DrillbitE" +
      "ndpoint\022\017\n\007address\030\001 \001(\t\022\021\n\tuser_port\030\002 " +
      "\001(\005\022\024\n\014control_port\030\003 \001(\005\022\021\n\tdata_port\030\004" +
      " \001(\005\022\032\n\005roles\030\005 \001(\0132\013.exec.Roles\022\017\n\007vers" +
      "ion\030\006 \001(\t\022+\n\005state\030\007 \001(\0162\034.exec.Drillbit" +
      "Endpoint.State\"<\n\005State\022\013\n\007STARTUP\020\000\022\n\n\006" +
      "ONLINE\020\001\022\r\n\tQUIESCENT\020\002\022\013\n\007OFFLINE\020\003\"i\n\024" +
      "DrillServiceInstance\022\n\n\002id\030\001 \001(\t\022\033\n\023regi" +
      "strationTimeUTC\030\002 \001(\003\022(\n\010endpoint\030\003 \001(\0132" +
      "\026.exec.DrillbitEndpoint\"\227\001\n\005Roles\022\027\n\tsql",
      "_query\030\001 \001(\010:\004true\022\032\n\014logical_plan\030\002 \001(\010" +
      ":\004true\022\033\n\rphysical_plan\030\003 \001(\010:\004true\022\033\n\rj" +
      "ava_executor\030\004 \001(\010:\004true\022\037\n\021distributed_" +
      "cache\030\005 \001(\010:\004trueB3\n\033org.apache.drill.ex" +
      "ec.protoB\022CoordinationProtosH\001"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_exec_DrillbitEndpoint_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_exec_DrillbitEndpoint_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_DrillbitEndpoint_descriptor,
              new java.lang.String[] { "Address", "UserPort", "ControlPort", "DataPort", "Roles", "Version", "State", });
          internal_static_exec_DrillServiceInstance_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_exec_DrillServiceInstance_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_DrillServiceInstance_descriptor,
              new java.lang.String[] { "Id", "RegistrationTimeUTC", "Endpoint", });
          internal_static_exec_Roles_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_exec_Roles_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_Roles_descriptor,
              new java.lang.String[] { "SqlQuery", "LogicalPlan", "PhysicalPlan", "JavaExecutor", "DistributedCache", });
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}
